home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_13_11 / phillip2 / numcvrt.c < prev    next >
C/C++ Source or Header  |  1993-05-11  |  827b  |  62 lines

  1.  
  2.     /******************************************
  3.     *
  4.     *  file d:\cips\numcvrt.c
  5.     *
  6.     *  Functions:
  7.     *     get_integer
  8.     *     get_short
  9.     *     get_long
  10.     *     get_float
  11.     *
  12.     *  Purpose: 
  13.     *     These functions read numbers from
  14.     *     the keyboard.
  15.     *
  16.     *  Modifications:
  17.     *     12 May 1993 - recreated
  18.     *
  19.     *******************************************/
  20.  
  21.  
  22.  
  23.  
  24. get_integer(n)
  25.    int *n;
  26. {
  27.    char string[80];
  28.  
  29.    gets(string);
  30.    *n = atoi(string);
  31. }
  32.  
  33.  
  34. get_short(n)
  35.    short *n;
  36. {
  37.    char string[80];
  38.  
  39.    gets(string);
  40.    *n = atoi(string);
  41. }
  42.  
  43.  
  44. get_long(n)
  45.    long *n;
  46. {
  47.    char string[80];
  48.  
  49.    gets(string);
  50.    *n = atol(string);
  51. }
  52.  
  53.  
  54. get_float(f)
  55.    float *f;
  56. {
  57.    char string[80];
  58.  
  59.    gets(string);
  60.    *f = atof(string);
  61. }
  62.